package com.jobs.model;

import java.util.Date;

import com.jobs.core.Job;

public abstract class AbstractJob implements Job {
	private String name;
	private String description;
	private JobStatus status;
	private Date startDate;
	private long totalIdleTime = 0L;
	private JobPriority priority;

	public AbstractJob(String jobName, String jobDescription, JobPriority priority) {
		this.name = jobName;
		this.description = jobDescription;
		this.priority = priority;
	}

	@Override
	public void run() {
		//Pre Job Execution Work.
		//Like stamping time and initializing idle time variable.
		execute();
		//Post Job Execution Work.
	}

	@Override
	public final String getJobName() {
		return this.name;
	}

	@Override
	public final String getJobDescription() {
		return this.description;
	}

	@Override
	public final JobPriority getJobPriority() {
		return this.priority;
	}

	@Override
	public final JobStatus getJobStatus() {
		return this.status;
	}
}
